package com.my.study.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.my.study.excel.pojo.CompanyInfo;

import java.util.List;

/**
 * @author Carlos
 * @version 1.0.0
 * @date 2022/3/5 8:21
 */
public class CompanyInfoListener implements ReadListener<CompanyInfo> {

    private List<CompanyInfo> result;

    public CompanyInfoListener(List<CompanyInfo> result) {
        this.result = result;
    }

    @Override
    public void invoke(CompanyInfo data, AnalysisContext context) {
        result.add(data);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
